﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using IView.DiaryAndTracking;
using Engine;
using DataTransferObject.DiaryAndTrackingTask.SupportClassForUpdateTask;

namespace Presenter.DiaryAndTracking
{
    public class PresenterTaskReportForm : Presenter
    {
        private ITaskReportForm _view;
        private JskeEngine jskeEngine = JskeEngine.getInstance(dataServiceMode);

        public PresenterTaskReportForm(ITaskReportForm view, int dataAccessMode)
        {
            Presenter.changeDataServiceMode(dataAccessMode);
            this._view = view;
            jskeEngine.loadTrackingTaskData();
        }

        public void drawPieChart()
        {
            _view.drawPieChart(jskeEngine.getPiechartData());
            _view.setHeaderText("Task Name");
            _view.setTransparency3D(false);
        }

        public void drawTaskBurndown(DateTime from, DateTime to)
        {
            _view.drawTaskBurndown(jskeEngine.getBurndownData(from, to));
        }

        public void drawPriorityChart(String headerText)
        {            
            _view.drawPieChart(jskeEngine.getTaskPriorityData());
            _view.setHeaderText(headerText);
            _view.setChart3DStyle(true);
            _view.setChartPercentLengendtxt(true);
            _view.setTransparency3D(true);
        }
    }
}